package com.wencai.util;

/**
 * @author wangpan
 * @date 2023/5/13
 */
public class SellStrategy {
    // 以百分比计的涨幅, 例如设置的涨幅为10%, 则输入10
    private double higherValue;
    // 以百分比计算的跌幅, 例如设置的跌幅为10%, 则输入-10
    // 如果同时输入限制的涨幅和跌幅, 则要求涨幅必须大于跌幅
    private double lowerValue;
    private SellStrategyType sellStrategyType;

    public static SellStrategy getDefault() {
        return new SellStrategy();
    }

    public SellStrategy() {
        this.higherValue = -1;
        this.lowerValue = -1;
        this.sellStrategyType = SellStrategyType.NORMAL;
    }

    public SellStrategy(double higherValue, double lowerValue, SellStrategyType sellStrategyType) {
        this.higherValue = higherValue;
        this.lowerValue = lowerValue;
        this.sellStrategyType = sellStrategyType;
    }

    public double getHigherValue() {
        return higherValue;
    }

    public void setHigherValue(double value) {
        this.higherValue = value;
    }

    public double getLowerValue() {
        return lowerValue;
    }

    public void setLowerValue(double lowerValue) {
        this.lowerValue = lowerValue;
    }

    public SellStrategyType getSellStrategyType() {
        return sellStrategyType;
    }

    public void setSellStrategyType(SellStrategyType sellStrategyType) {
        this.sellStrategyType = sellStrategyType;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("SellStrategy{");
        sb.append("higherValue=").append(higherValue);
        sb.append(", lowerValue=").append(lowerValue);
        sb.append(", sellStrategyType=").append(sellStrategyType);
        sb.append('}');
        return sb.toString();
    }
}
